<template>
<div>
    <van-nav-bar title="" left-arrow @click-left="$router.back()">
    </van-nav-bar>
    <van-form>
        <van-field
        v-model="password"
        type="password"
        name="password"
        label="旧密码"
        placeholder="旧密码"
        :rules="[
          { required: true, message: '请填写您的旧密码' },
          {
            validator: (e) => /^\w{6,12}$/.test(e),
            message: '密码格式错误,需要是6-12位的字母或数字',
          },
        ]"
      />
        <van-field
        v-model="password"
        type="password"
        name="password"
        label="新密码"
        placeholder="新密码"
        :rules="[
          { required: true, message: '请填写您的新密码' },
          {
            validator: (e) => /^\w{6,12}$/.test(e),
            message: '密码格式错误,需要是6-12位的字母或数字',
          },
        ]"
      />
      <!-- <van-field
        v-model="vercode"
        name="vercode"
        label="验证码"
        placeholder="请填写验证码"
        clearable
        :rules="[
          { required: true, message: '请填写验证码' },
          { pattern: /^\d{6}$/, message: '验证码格式错误' },
        ]"
      >
        <template #button>
          <van-button
            size="small"
            type="primary"
            @click="sendSms"
            native-type="button"
            :disabled="codeBtnDisabled"
            >{{code_text}}</van-button
          >
        </template>
      </van-field> -->
      <div style="margin: 30px 50px">
        <van-button
          round
          block
          type="info"
          color="#07c160"
          size="normal"
          :square="true"
          native-type="submit"
          >确定</van-button
        >
      </div>
    </van-form>
</div>
</template>
<script>
import {Form,Field} from "vant"
export default {
    components:{
        [Form.name]:Form,
        [Field.name]:Field,
    },
    data(){
        return{
            username: "",
            password: "",
            vercode: "",
            codeBtnDisabled:false,
            code_text:"发送验证码"
        }
    },
    
}
</script>
<style>

</style>